package ch06.ex1_1_NullableTypes

/**
 * Created by caozp-ytcyc2007 on 2017/5/26.
 */

fun strLenSafe(s: String?): Int = if (s != null) s.length else 0

fun main(args: Array<String>) {
    val x: String? = null
    println(strLenSafe(x))
    println(strLenSafe("abc"))
}